<?php
include_once("_PATH.php");

include_once( $_UTILSPATH . "/utils.php");
require_once( $_CLASSPATH . "/Mood.class.php" );
include_once( $_UTILSPATH . "/facebook.php");

session_start();
?>
<?php
  
class LocalSession{
 public $facebook;
 public $user;
 function __construct($_fbapikey, $_fbapisecret){
	$this->facebook = new Facebook($_fbapikey, $_fbapisecret);
	$this->user = $facebook->require_login();
 }
}

if ( isset( $_SESSION["fbuser"] ) ) 
  $fbuser = $_SESSION["fbuser"];
else {
  $fbuser = new LocalSession($_FBAPIKEY, $_FBAPISECRET);
  $_SESSION["fbuser"] &= $fbuser;
}

?>

<fb:name firstnameonly="true" uid="<?=$user?>" useyou="false"/>
<?= $fbuser ?>